<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<script>

  //Access-Control-Allow-Origin:'*'
  window.onload = function () {
    var xhr = new XMLHttpRequest() || new ActiveXObject("Microsoft.XMLHTTP");
    xhr.onreadystatechange = function () {
      if (this.readyState === 4 && this.status === 200) {
        //console.log(JSON.parse(this.response))
        console.log(JSON.parse(this.responseText));
      }
    };
    xhr.open('GET', 'https://www.linqinghu.cn/my/public/api/getHouseAllList', true);
    xhr.send(null);
  }
  window.onload = function () {
    var xhr = new XMLHttpRequest() || new ActiveXObject("Microsoft.XMLHTTP");
    xhr.onreadystatechange = function () {
      if (this.readyState === 4 && this.status === 200) {
        console.log(JSON.parse(this.response));
      }
    };
    xhr.open("POST", 'url', true);
    xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");    //设置请求头
    xhr.send("fname=Bill&lname=Gates")
  }
</script>
</body>
</html>